package ac.beiwo.baas.console.util;

/**
 * Created by Codi on 15/11/23.
 */
public class NumberUtil {

    public static String shortNumber(long number, boolean zero) {
        if (!zero) {
            if (number <= 0) {
                return "";
            }
        }
        if (number < 10000) {
            return String.valueOf(number);
        } else {
            if (number % 10000 / 1000 > 0)
                return String.valueOf(number / 10000) + "." + String.valueOf((number % 10000) / 1000) + "万";
            else
                return String.valueOf(number / 10000) + "万";
        }
    }
}
